import requests
# army_url = r"http://81rc.81.cn/sy/xzzq_210288/_attachment/2023/08/12/16244568_f5ee4f4d22458a762f871eb5d52f3a3f.pdf"
army_url = r"http://81rc.81.cn/sy/xzzq_210288/_attachment/2023/08/12/16244568_34bc0ff8e7f761ba22a6c91a368d47e9.pdf"
headers={
    "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/124.0.0.0 Safari/537.36 Edg/124.0.0.0",
    "Accept":"text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.7",
    "Accept-Encoding":"gzip, deflate",
    "Accept-Language":"en,zh-CN;q=0.9,zh;q=0.8"
}

reqs=requests.get(url=army_url,headers=headers)
reqs.encoding = reqs.apparent_encoding

with open("军队文职考试管理学.pdf",'wb') as f:
    f.write(reqs.content)
